Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit timeupdate when calling setTime #3593

Merged

Conversation

jagthedrummer
Copy link
Collaborator

Short description

This makes it so that the regions plugin will fire region-in and region-out events when audio is not loaded into wavesurfer.

Resolves #3570

Implementation details

This just fires a timeupdate event in the setTime method. This was the smallest change I could make to get the regions plugin to fire events.

If there's a better way to make this happen I'd love to hear some suggestions.

How to test it

Use pre-decoded peaks and a duration to render a wavesurfer with no audio loaded. Add the regions plugin, and add a region. Add a region-in handler to the regions plugin, and then call wavesurfer.setTime() with a value inside the region. The handler for the region-in event should fire.

Screenshots

N/A

Checklist

  • This PR is covered by e2e tests
  • It introduces no breaking API changes

Copy link
Owner

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you! 🙏

@katspaugh
Copy link
Owner

@jagthedrummer I’ve invited you to be a collaborator so that you can more easily contribute directly to the repo. Cheers! 🚀

@katspaugh katspaugh merged commit 2090625 into katspaugh:main Mar 12, 2024
2 checks passed
@jagthedrummer
Copy link
Collaborator Author

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

region-in and region-out events don't fire if audio isn't loaded
2 participants